<template>
	<el-dialog v-model="dialogVisible" :title="`${title}数据表`" draggable>
		<el-form :model="form">
			<el-form-item label="数据表名称" :label-width="formLabelWidth">
				<el-input v-model="form.tableLabel" autocomplete="off" />
			</el-form-item>
			<el-form-item label="数据表标识" :label-width="formLabelWidth">
				<el-input v-model="form.tableName" autocomplete="off" />
			</el-form-item>
		</el-form>
		<template #footer>
			<span class="dialog-footer">
				<el-button @click="dialogVisible = false">Cancel</el-button>
				<el-button type="primary" @click="dialogVisible = false">Confirm</el-button>
			</span>
		</template>
	</el-dialog>
</template>

<script lang="ts" setup name="freeTableDialog">
import { reactive, ref } from "vue";

const formLabelWidth = "140px";
const dialogVisible = ref(false);
const title = ref("");
const form = reactive({
	tableLabel: "",
	tableName: ""
});

const acceptParams = (params: any) => {
	title.value = params.title;
	form.tableLabel = params.rowData.tableLabel;
	form.tableName = params.rowData.tableName;
	dialogVisible.value = true;
};

defineExpose({
	acceptParams
});
</script>

<style scoped></style>
